//
//  UIColor+YCTools.h
//  Pods
//
//  Created by Apple on 2022/11/1.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIColor (YCTools)

/// 生成颜色
/// @param hexString 16进制颜色字符串
+ (UIColor *)colorWithHexString:(NSString *)hexString;

/// 生成颜色
/// @param hexString 16进制颜色字符串
/// @param opacity 透明度
+ (UIColor *)colorWithHexString:(NSString *)hexString alpha:(float)opacity;

/// 渐变颜色
/// @param fromColor 开始颜色
/// @param toColor 结尾颜色
/// @param horizontal 是否水平方向
/// @param viewSize 赋值的视图size
+ (UIColor *)colorWithGradientFromColor:(UIColor *)fromColor
                                toColor:(UIColor *)toColor
                           isHorizontal:(BOOL)horizontal
                               viewSize:(CGSize)viewSize;

/// 渐变色
/// @param colors 渐变色数组
/// @param horizontal 是否水平方向
/// @param viewSize 赋值的视图size
+ (UIColor *)colorWithGradientColors:(NSArray<UIColor *> *)colors
                        isHorizontal:(BOOL)horizontal
                            viewSize:(CGSize)viewSize;

@end

NS_ASSUME_NONNULL_END
